namespace FreeSwitch.EventSocket.Events.Channel
{
	/// <summary>
	/// Function have been executed on channel
	/// </summary>
	[EventName("CHANNEL_EXECUTE")]
    public class ChannelExecute : ChannelStateEvent
    {
		public string AppName { get; set; }

		public string Arguments { get; set; }

		public override bool ParseCommand(string name, string value)
		{
			switch (name)
			{
				case "application":
					AppName = value;
					break;
				case "application-data":
					Arguments = value;
					break;
				default:
					return base.ParseCommand(name, value);
			}

			return true;
		}

		public override string ToString()
        {
            return "ChannelExecute(" + AppName + ", '" + Arguments + "')." + base.ToString();
        }
    }
}
